ac.buff('光环'){
    cover_type = 1,
    cover_max = 0,
    pulse = 0.25,
    aura_time = 1,      --维持时间,
    aura_area = 900,
    area_type = 'ally',    --敌人/友军/全部 enemy/ally/all,
    aura_point = nil,   --光环点,
    buff_name = '',   --子效果名,
    keep = true,      --是否保持,
    model = nil,
    ref = 'origin',
    on_add = function(self)
        local hero = self.owner
        self.buff_data = self.buff_data or {}
        self.buff_data.time = self.aura_time
        self.buff_data.is_aura = true
        self.buff_data.source = hero
        if not self.selector then
            self.selector = ac.selector('unit'):range(self.aura_point or hero,self.aura_area)
            if self.area_type=='ally' then
                self.selector = self.selector:ally(hero)
            elseif self.area_type=='enemy' then
                self.selector = self.selector:enemy(hero)
            end
        end
        if self.model then
            self:gc(hero:add_effect(self.model,self.ref))
        end
    end,
    on_pulse = function(self)
        local hero = self.owner
        if hero:is_alive()==false then
            return
        end
        local update = {}
        self.has_unit = self.has_unit or {}
        if self.selector and hero:is_alive() then
            for u in self.selector:loop() do
                if self.has_unit[u.handle] and self.has_unit[u.handle]:get_remaining()>0 then
                    update[u.handle] = self.has_unit[u.handle]
                    update[u.handle]:set_remaining(self.aura_time)
                else
                    update[u.handle] = u:add_buff(self.buff_name)(table.copy(self.buff_data))
                end
                
            end
        end
        self.has_unit = update
    end
}
